<?php 
    if($searchTopic):
        foreach ($searchTopic as $topic) {
            # code...
    ?>

    <article class="<?php
                    if ($topic->topic_news_type == "video") {
                        echo "hasvideo";
                    } elseif ($topic->topic_news_type == "picture") {
                        echo "picture";
                    } else {
                        echo "";
                    }
                    ?>">
            <p class="type"></p>
            <div class="cover" style="background-image: url(<?php echo $topic->topic_news_picture;?>)">
                    <a href="<?=site_url('home/detail').'/'.$topic->topic_news_id?>"></a>
            </div>
            <header>
                    <h1>
                    <a href="<?=site_url('home/detail').'/'.$topic->topic_news_id?>">
                    <?=$topic->topic_news_title?>
                    </a>

                    </h1>
                    <time datetime="<?=date('Y-m-d H:i:s', $topic->topic_news_date)?>"></time>
                    <p class="cate"><?php 
                        $CI = & get_instance();
                        $CI->load->model('category_model');
                        $cate = $CI->category_model->getInfo($topic->category_id);
                    echo $cate->category_name;?></p>
                    <p class="summary"><?php echo substr(strip_tags($topic->topic_news_content), 0,200).'...'; ?></p>
            </header>
    </article>
    <?php } endif;?>